package com.ywjt.platformbusiness.widget;

import android.content.Context;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.TextView;

import com.ywjt.platformbusiness.R;
import com.ywjt.platformbusiness.base.BaseBottomDialog;

import java.util.Timer;
import java.util.TimerTask;

public class CommentBottomDialog extends BaseBottomDialog {

    private EditText etText;
    Timer timer = new Timer();
    private ClickListenerInterface clickListenerInterface;

    public interface ClickListenerInterface {

    }

    public CommentBottomDialog() {
    }

    @Override
    public int getLayoutRes() {
        return R.layout.dialog_comment_bottom;
    }

    @Override
    public void bindView(View v) {
        etText=v.findViewById(R.id.etText);
        etText.setFocusable(true);
        etText.setFocusableInTouchMode(true);
        etText.requestFocus();

        timer.schedule(new TimerTask()
        {
            public void run()
            {
                InputMethodManager inputManager =(InputMethodManager)etText.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
                inputManager.showSoftInput(etText, 0);
            }
        },500);
    }

    public void setClicklistener(ClickListenerInterface clickListener) {
        clickListenerInterface = clickListener;
    }

    private class clickListener implements View.OnClickListener {

        @Override
        public void onClick(View v) {
            switch (v.getId()) {

            }
        }
    }
}
